package com.leo;

import javafx.beans.property.SimpleIntegerProperty;

/**
 * @ClassName OneWayBindingDemo
 * @Description 单向绑定
 * @Author wangss
 * @date 2020.05.29 11:24
 * @Version 1.0
 */
public class OneWayBindingDemo {

    public static void main(String[] args) {
        SimpleIntegerProperty x = new SimpleIntegerProperty(1);

        SimpleIntegerProperty y = new SimpleIntegerProperty(5);

        // x绑定到y上，这时x的值随y变化
        x.bind(y);

        System.out.println(x);
        System.out.println(y);
    }
}
